package com.ww.learn.coroutine.flow

fun simple2(): Sequence<Int> = sequence {
    for (i in 1..3) {
        Thread.sleep(100)
        yield(i) // 产生下一个值
    }
}

fun main() {
    simple2().forEach { value -> println(value) }
}